#ifndef INCLUDED_IMAGEBUTTON_H
#define INCLUDED_IMAGEBUTTON_H

#include <gtk/gtk.h>
#include <string>

class ImageButton {
public:
    // Parameters img and imgOn both are image file's path. Img is what the
    // button will look like, while imgOn is the button's appearance when the
    // cursor is inside the button.
    ImageButton(const std::string &imgPath, const std::string &imgOnPath);
    ~ImageButton();

    GtkWidget *GetWidget() const;

private:
    // If you want to do something others when the button is clicked, just
    // modify the OnButtonPress function
    virtual gboolean OnButtonPress(GtkWidget *widget,
        GdkEventButton *event);
    static gboolean EnterNotifyCallback(GtkWidget *widget,
        GdkEventCrossing *event,
        gpointer data);
    static gboolean LeaveNotifyCallback(GtkWidget *widget,
        GdkEventCrossing *event,
        gpointer data);
    static gboolean ButtonPressCallback(GtkWidget *widget,
        GdkEventButton *event,
        gpointer data);
    // Change the button's appearance by using a new image
    static void RefreshButton(GtkWidget *eventBox, const std::string &imgPath);

    static std::string _imgPath;
    static std::string _imgOnPath;
    
    GtkWidget *_eventBox;
};

#endif